import { Body, Controller, Get, Post, Query } from '@nestjs/common';
import { ActionResultTemplateInterface } from 'src/common/ResponseResult';
import UserDaoImpl from './../Impl/UserDaoImpl';

@Controller('user')
export default class UserController {
  constructor(private readonly UserDao: UserDaoImpl) {}

  @Get('queryUser')
  queryUser(
    @Query('userName') userName: string,
  ): Promise<ActionResultTemplateInterface> {
    return this.UserDao.queryUser(userName);
  }
  @Post('registerUser')
  registerUser(
    @Body('userName') userName: string,
    @Body('userRealName') userRealName: string,
    @Body('userPassword') userPassword: string,
    @Body('rePassword') rePassword: string,
    @Body('userMobile') userMobile: string,
  ) {
    return this.UserDao.registerUser(
      userName,
      userRealName,
      userPassword,
      rePassword,
      userMobile,
    );
  }
}
